#pragma once

#include "GameStateInfo.h"
#include "GameScene.h"
#include "GameInputWnd.h"
#include "MouseChecker.h"


#include "GameResult.h"

class RectSelectButton;




class GameStage
{
public:
	GameStage();
	~GameStage();

	enum STATE
	{
		STATE_TITLE,
		STATE_GAME,
		STATE_SELECTSTAGE,
		STATE_CREDIT,
		STATE_RESULT,
	};

public:
	void			Init(int nStageIndex);
	void			Terminate();
	void			Update();
	void			Draw();

	void			OnMouseMove(int nX, int nY);
	void			OnMouseLDown(int nX, int nY);
	void			OnMouseLUp(int nX, int nY);

	void			SetNextState(int next);
	int				GetCurState();


	void			GoTitle();
	void			GoCredit();
	void			GoSelectStage();
	void			GoGame(int nStageIndex);
	void			GoExit();
	void			GoResult(Score &score);


	GameStateInfo	m_StateInfo;
	GameScene		m_Scene;

private:

	STATE			m_state;

	bool			m_bTitle;


	RectSelect*			m_pLastSelect;

	RectStatic*			m_rectTitle;
	RectStatic*			m_rectCredit;
	RectStatic*			m_selectStage;

	RectStatic*			m_rectTitleName[17];
	int					m_cntTitleName;


	RectSelectButton*	m_pStart;
	RectSelectButton*	m_pCredit;
	RectSelectButton*	m_pExit;
	RectSelectButton*	m_pBack;
	MouseChecker		m_mouseCheckerTitle;

	RectSelectButton*	m_pStage1;
	RectSelectButton*	m_pStage2;
	RectSelectButton*	m_pStage3	;
	RectSelectButton*	m_pStage4;




	GameResult		m_result;
	GameInputWnd	m_InputWnd;
};
